import * as Utils from 'utils.js'
/**
 * 速云权限设置api 
 */


/**
 * @param {Object}获取当前用户权限
 */
export  function Gain_AllUsersRoot(arr,callBack){
	let url = Utils.getPostIp("/api/Gain_AllUsersRoot");
	let data = Utils.getData(arr);
	var responseArr =  {};
	Utils.httpGetClient(url,data,"POST",function(data,state){
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}

/**
 * @param {Object}获取当前用户权限
 */
export  function SaveBillRoot(arr,callBack){
	let url = Utils.getPostIp("/api/Save_BillRoot");
	let data = Utils.getData(arr);
	var responseArr =  {};
	Utils.httpGetClient(url,data,"POST",function(data,state){
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}
//提示框
export  function showTip(msg) {
	uni.showToast({
		position: 'bottom',
		title: msg,
		style:"z-index:9999"
	});
};
//确认框
export  function showConfirm(msg,sureClick){
	uni.showModal({
	    title: '提示',
	    content: msg,
	    success: function (res) {
	        if (res.confirm) {
	            sureClick(true);
	        } else if (res.cancel) {
	            sureClick(false);
	        }
	    }
	});
}
/** 
权限设置: 保存单据权限接口Save_BillRoot
**/

export function Save_BillRoot(arr, callBack) {
	let url = Utils.getPostIp("/api/Save_BillRoot");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}
/** 
权限设置: 保存开单单价权限接口Save_BillPriceRoot
**/

export function Save_BillPriceRoot(arr, callBack) {
	let url = Utils.getPostIp("/api/Save_BillPriceRoot");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}

/** 
权限设置: 保存商品查询单价权限接口Save_BillPriceRoot
**/

export function Save_GoodSelect_PriceRoot(arr, callBack) {
	let url = Utils.getPostIp("/api/Save_GoodSelect_PriceRoot");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}

/** 
权限设置: 保存仓库权限接口Save_BillPriceRoot
**/

export function Save_StoreRoot(arr, callBack) {
	let url = Utils.getPostIp("/api/Save_StoreRoot");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}


/** 
权限设置: 保存功能权限接口Save_BillPriceRoot
**/

export function Save_ModuleRoot(arr, callBack) {
	let url = Utils.getPostIp("/api/Save_ModuleRoot");
	let data = Utils.getData(arr);
	var responseArr = {};
	Utils.httpGetClient(url, data, "POST", function(data, state) {
		console.log(data);
		responseArr.data = data.data;
		responseArr.state = state;
		callBack(responseArr);
	});
}

